package com.my.app.http;

import org.springframework.data.domain.Page;

/**
 * Created by 80002023 on 2016/6/7.
 */
public class PageResult<T> extends BaseResult<T> {

    public int pageNum = 1;
    public int pageSize = 10;
    public long total;
    public int totalPages;

    public PageResult() {
    }

    public PageResult(Page<T> page, int pageNum, int pageSize) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = page.getTotalElements();
        this.totalPages = page.getTotalPages();
        this.records = page.getContent();
    }

}
